<?php require APP_ROOT.'public/top.php';?>

<div class="admincp-container unfold">
  <?php require APP_ROOT.'public/left.php';?>
  <div class="g-ct">
    <div data-v-3478fe82="">
      <ul data-v-3478fe82="" id="type-tab" class="w-tab">
        <li data-v-3478fe82="" class="first z-crt"><a data-v-3478fe82="" href="/account/financial/index">财务管理</a></li>
        <!---->
      </ul>
      <div data-v-3478fe82="">
        <div data-v-3478fe82="">
          <div style="margin: 20px 0px;"><span id="mode" class="mode" style="border: 1px solid rgb(204, 204, 204); border-radius: 5px; padding: 5px 10px;"><a href="index.php?m=member&a=balance">充值记录</a> &nbsp; <i style="color: rgb(204, 204, 204);">|</i> &nbsp; <a href="index.php?m=member&a=bdetaileds" class="active">消费明细</a></span></div>
          
        </div>
      </div>
      
      <div>
            <div style="margin-top: 20px;">
              <h4 class="g-ct-title2"> 账户&nbsp;:&nbsp;<?php echo $member['username'];?> </h4>
              <ul class="site-fina-recharge f-cb">
                <li class="f-fl"> 实时余额&nbsp;:&nbsp;<span class="f-green"><?php echo $balance;?></span>元&nbsp;&nbsp;&nbsp;&nbsp; <span class="f-gray">预计可消费<font class="f-red">0</font>天</span></li>
              </ul>
            </div>
            <div style="margin-top: 20px;">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/echarts.min.js"></script>
    <style>
        #someline {			
            width: 100%;
            height: 500px; z-index:1000;
        }
    </style>
    <script>
      $(document).ready(function(){
        var chart = document.getElementById("someline");
        var echart = echarts.init(chart);
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['消费金额']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['<?php echo implode('\',\'',get_week());?>']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name: '消费金额',
                    type: 'line',
                    stack: '总量',
                    data: [<?php echo implode(',',consumption_price($member_id));?>]
                }
            ]
        };



        echart.setOption(option);
      });
    </script>
<div id="someline"></div>


              <div data-v-6f5551eb="" class="table-container f-cb" id="finacialTable">
                <table data-v-6f5551eb="" class="grid">
                  <thead data-v-e0b3f32e="" data-v-6f5551eb="" class="grid-head">
                    <tr data-v-e0b3f32e="">
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 时间 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 曝光量 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 点击量 </th>
                      <th data-v-e0b3f32e="" class=""><em data-v-e0b3f32e="" class="sort" style="display: none;"></em> 消费金额 </th>
                    </tr>
                  </thead>
                  <tbody data-v-6f5551eb="" class="grid-body">
                  <?php
                    $get_week=get_week();
                    $start_date=M('account')->where(array('member_id'=>$member_id))->order('account_id asc')->getfield('date');
                    $end_date=M('account')->where(array('member_id'=>$member_id))->order('account_id desc')->getfield('date');
                    while ($end_date>=$start_date){
                        $date[]=strtotime(date('Y-m-d',$end_date))+60*60*24;
                        $end_date= strtotime('-1 day',$end_date);
                      	
                    }
                    //print_r($date);
                    foreach($date as $k=>$v)
                    {
                        $acc=M('account')->where('member_id='.$member_id.' and amount_type=2 and date<'.$v.' and date>'.($v-60*60*24))->sum('amount');
                      	$acc=sprintf("%.2f",$acc==''?0:$acc);
                      
                      $zxcs=M('datedata')->where('member_id='.$member_id.' and date<'.$v.' and date>'.($v-60*60*24))->getfield('zxcs');
		//$amount[]=M()->_sql();
        $zxcs=$zxcs==''?0:$zxcs;
                      
                      
                      $djcs=M('datedata')->where('member_id='.$member_id.' and date<'.$v.' and date>'.($v-60*60*24))->getfield('djcs');
		//$amount[]=M()->_sql();
        $djcs=$djcs==''?0:$djcs;
                      
                      
                        //echo M()->_sql().'<br>';
                      if($acc){
						?>
                    <tr class="">
                      <td class=""><?php echo cover_time($v-60*60*24,'Y-m-d H:i:s');?></td>
                      <td class=""> ￥<?php echo $zxcs;?> </td>
                      <td class=""> ￥<?php echo $djcs;?> </td>
                      <td class=""> ￥<?php echo $acc;?> </td>
                    </tr>
                    <?php } }?>
                    
                  </tbody>
                </table>
                <div data-v-3f753227="" data-v-6f5551eb="" class="table-page"><span data-v-3f753227="" class="total">总共3项</span> <span data-v-3f753227="">每页显示&nbsp;</span>
                  <div data-v-2f1fe2e8="" data-v-3f753227="" class="select-x">
                    <input data-v-2f1fe2e8="" type="hidden" name="" value="20">
                    <label data-v-2f1fe2e8="" class="select-box" style="width: 100px;"><span data-v-2f1fe2e8="" class="select-text" style="width: 90px;">20行</span><span data-v-2f1fe2e8="" class="btn-drop down"></span></label>
                    <ul data-v-2f1fe2e8="" class="select-lists f-dn" style="width: 100px; height: 94px; top: 32px; background: rgb(255, 255, 255); z-index: 100;">
                      <li data-v-2f1fe2e8="" title="20行" data-value="20" class="select-item selected">20行 </li>
                      <li data-v-2f1fe2e8="" title="50行" data-value="50" class="select-item">50行 </li>
                      <li data-v-2f1fe2e8="" title="100行" data-value="100" class="select-item">100行 </li>
                    </ul>
                  </div>
                  <label data-v-3f753227="" class="btn-page pre-page btn-disable">&lt;</label>
                  <span data-v-3f753227="" value="1" class="pages active margin-0">1</span> <span data-v-3f753227="" class="dot pre" style="display: none;">...</span> <span data-v-3f753227="" class="dot last" style="display: none;">...</span> <span data-v-3f753227="" value="1" class="pages active margin-0" style="display: none;">1</span>
                  <label data-v-3f753227="" class="btn-page next-page btn-disable">&gt;</label>
                  <label data-v-3f753227="" class="to-page"> 前往&nbsp;
                    <input data-v-3f753227="" type="text" class="c-input">
                    &nbsp;页 </label>
                </div>
                <div data-v-6f5551eb="" style="display: none;">
                  <div data-v-6f5551eb="">时间 </div>
                  <div data-v-6f5551eb="">金额 </div>
                  <div data-v-6f5551eb="">交易后金额 </div>
                </div>
              </div>
            </div>
          </div>
          
    </div>
  </div>
  
</div>
<?php require APP_ROOT.'public/bottom.php';?>




